<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <!--如果是IE 就以标准渲染-->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

    <!-- 视窗——————响应式布局 -->
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />

    <!--当前页面的三要素-->
    <title>运维系统-处理回单</title>
    <meta name="description" content="聚能优电" />
    <meta http-equiv="keywords" content="聚能优电" />
    <script type="text/javascript" src="../../js/verify.js"></script>
    <!-- css -->
    <link rel="stylesheet" type="text/css" href="../../css/common/common.css" />
    <link rel="stylesheet" type="text/css" href="../../css/orderdetail.css" />
</head>

<body>
    <div id="container" class="orderdetail">
        <div class="orderdetail_01">
            <!--主屏内容-->
            <div class="orderdetail_screen">
                <div class="m_title">
                    <a href="JavaScript:history.go(-1);" class="back">
                        <img src="../../images/back.svg" alt="">
                    </a>
                    <span class="tit">处理回单</span>
                </div>


                <ul class="gj_con" style="margin-top: 1.55rem;">
                    <li>
                        <span class="lileft">回单时间</span><span class="liright">XXXXXXXX</span>
                    </li>
                    <li>
                        <span class="lileft">回单人</span><span class="liright">XXXXXXXX</span>
                    </li>
                    <li>
                        <span class="lileft">处理结果</span><span class="liright">XXXXXXXX</span>
                    </li>
                </ul>
                
                <div class="cljg hdnr_con">
                    <div class="cljg_tit tit" style="margin-top:0.3rem;">处理措施</div>
                    <div class="hdcs">
                        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                    </div>
                </div>

                <div class="clcs hdnr_con">
                    <div class="clcs_tit tit" style="margin-top:0.3rem;">回单附件</div>
                    <div class="hdfj">
                        <span>xxxx.pdf</span>
                        <span>xxxx.pdf</span>
                        <span>xxxx.pdf</span>
                        <span>xxxx.pdf</span>
                        <span>xxxx.pdf</span>
                        <span>xxxx.pdf</span>

                    </div>
                </div>

            </div>
        </div>
    </div>


    <script>
        (function (win, doc) {
            var docEl = doc.documentElement || document.body; //获取HTML标签

            var container = doc.getElementById("container"); //container元素
            //判断是移动端设备还是PC,移动 就采用'orientationchange',横竖屏事件，PC端就采用onresize，窗口改变时间
            var resize =
                "onorientationchange" in win ? "orientationchange" : "resize";

            function rem() {
                docEl.style.fontSize = 100 * (container.clientWidth / 750) + "px";
            }

            //监听'DOMContent事件:DOM加载完成执行,如果DOMContent事件，那么执行rem函数
            doc.addEventListener("DOMContentLoaded", rem, false);

            //win下监听resize事件,如果resize事件，那么执行rem函数
            win.addEventListener(resize, rem, false);
        })(window, document);
    </script>
    <!-- js -->
    <script type="text/javascript" src="../../js/jquery-3.4.1.js"></script>
    <script type="text/javascript" src="../../js/swiper-3.4.2.min.js"></script>
    <script type="text/javascript" src="../../layer/layer.js"></script>
    <script>
        $(document).ready(function () {
            var getid = getQueryString('id');

            $.ajax({
                type: "GET",
                dataType: "json",
                // url: "http://112.74.169.99:21021/api/services/app/AlarmService/GetAlarmInfoById?id=" +
                //     getid,
                beforeSend: function (xhr) {
                    xhr.setRequestHeader("Accept",
                        "application/json, text/javascript, */*; q=0.01"
                    );
                    xhr.setRequestHeader("Authorization", accessToken);
                    xhr.setRequestHeader('.AspNetCore.Culture',
                        'zh-Hans');
                },
                success: function (res) {
                    console.log("请求成功");
                    var data = res.result;
                    // console.log(data)

                    // 页面题目
                    $("#con_tit").html(` `);
                    $("#con_tit").html(data.devname);

                    // 设备名称
                    $("#devname").html(` `);
                    $("#devname").html(data.devname);

                    // 所属项目
                    $("#belonepj").html(` `);
                    $("#belonepj").html("所属项目名称");

                    // 设备告警项
                    $("#devwarn").html(` `);
                    $("#devwarn").html(data.remark1);

                    if (data.alarmstate == 1) {
                        data.alarmstate = "已解除";
                    } else {
                        data.alarmstate = "告警中";
                    }
                    // 设备状态
                    $("#devstatus").html(` `);
                    $("#devstatus").html(data.alarmstate);


                    var alarmtimearr = data.alarmtime.split('T');
                    // 告警时间
                    $("#warnstart").html(` `);
                    $("#warnstart").html(alarmtimearr[0] + '  ' + alarmtimearr[1]);



                    // 告警时间
                    if (data.alarmstate == '已解除') {
                        var stopobj = `
                        <div class="datalista">
                            <span class="dataleft">告警结束时间</span>
                            <span class="dataright" id="warnstop">告警结束时间</span>
                        </div>
                        `;
                        $("#listdata").append(stopobj);
                        var solvetimearr = data.alarmtime.split('T');
                        $("#warnstop").html(` `);
                        $("#warnstop").html(solvetimearr[0] + '  ' + solvetimearr[1]);
                    }
                },
                error: function (err) {
                    console.log("请求失败");
                }
            });

            function getQueryString(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
                var r = window.location.search.substr(1).match(reg);
                if (r != null) return unescape(r[2]);
                return null;
            }




        });
    </script>

</body>

</html>